<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	//设置请求编码格式
	request.setCharacterEncoding("UTF-8");
	//获取用户名
	String userName = session.getAttribute("userName").toString();
	//获取用户输入的内容
	String msg = request.getParameter("msg");
	//msgInfo：一条完整的聊天记录
	String msgInfo = userName + " 说 ：" + msg;
	//存放聊天记录的集合
	List<String> msgList = null;
	//判断appliation中是否有聊天记录
	if (application.getAttribute("msgList") != null) {
		msgList = (List<String>) application.getAttribute("msgList");
	} else {
		msgList = new ArrayList<String>();
	}
	// application←msgList←msginfo
	msgList.add(msgInfo);
	application.setAttribute("msgList", msgList);
	response.sendRedirect("05sendmsg.jsp");
%>